package tcln.sors.client.main;

import javax.swing.JTable;
import javax.swing.ListSelectionModel;

import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.decorator.HighlighterFactory;

import tcln.sors.client.core.component.grid.JXGrid;
import tcln.sors.client.order.OrderModelData;

/**
 * A grid containing orders.
 * 
 * @author Truong Chau Lien Ngoc (lienngoc@gmail.com)
 */
class OrderGrid extends JXGrid<OrderModelData> {
    private static final long serialVersionUID = 1L;

    /**
     * {@inheritDoc}
     */
    @Override
    protected void initializeTable(JXTable table) {
        super.initializeTable(table);

        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        table.setColumnControlVisible(true);
        table.setRowHeight(24);
        table.setColumnSelectionAllowed(false);
        table.setShowGrid(false, false);
        table.setSortable(false);
        table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
        table.setHighlighters(HighlighterFactory.createAlternateStriping());
    }
}
